package com.smart.web.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.smart.consts.AppInteractiveState;
import com.smart.consts.AppStatusData;
import com.smart.model.Banner;
import com.smart.model.BannerCond;
import com.smart.model.base.JsonModel;

/**
 * banner
 * @author zhuyong
 *
 */
@Controller
public class AppBannerController extends BaseController{
	@RequestMapping("banner/getList")
	public void getList(String data,HttpServletRequest request, HttpServletResponse response) {
		JsonModel jsonModel = new JsonModel();
		AppStatusData statusObject = new AppStatusData();
		BannerCond cond = new BannerCond();
		List<Banner> list = null;
		if (requestHandle(data, jsonModel,statusObject)) {
			cond.addOrderBy("sort");
			list = bannerService.find(cond);
			statusObject = AppInteractiveState.SUCCESS_DATA;
			returnJson(response, statusObject, list);
		}
		returnJson(response,statusObject,null);
	}
}
